<?php
class User_Controller_Browse_Cardhover extends Nuo_Controller
{
	function execute($request)
	{
		$itemId = $request -> getParam('user_id');

		$user = Nuo::getTable('user') -> find($itemId) -> current();

		$viewer = Nuo::getUser();

		$userApi = Nuo::getApi('user');

		$statusId = 0;

		$isOwner = 0;

		if ($user && $user -> getId() == $viewer -> getId())
		{
			$isOwner = 1;
		}

		if ($user)
		{
			$statusId = $userApi -> getStatusId($viewer, $user);
		}

		return  array(
			'html' => $this -> render(array(
				'user' => $user,
				'isOwner' => $isOwner,
				'viewer' => $viewer,
				'statusId' => $statusId,
			)),
			'data_id' => $request -> getParam('data-id')
		);
	}

}
